import Immutable from 'immutable'

import {
  UPDATE_TOKEN
} from '../constants/actionType'

const initialState = Immutable.fromJS({
  token: ''
})

export default (state = initialState, action) => {
  let newState = state
  switch (action.type) {
    case UPDATE_TOKEN:
      console.log('==UPDATE_TOKEN==', action)
      newState = newState.set('token', action.response.data.token)
      return newState
    default :
      return state
  }
}
